FROM ros:kinetic

ENV ROS_ROOT=/opt/ros/kinetic/share/ros
ENV ROS_PACKAGE_PATH=/opt/stdr:/opt/ros/kinetic/share:/opt/ros/kinetic/stacks
ENV ROS_MASTER_URI=http://localhost:11311
ENV LD_LIBRARY_PATH=/opt/stdr/devel/lib:/opt/stdr/devel/lib/x86_64-linux-gnu:/opt/ros/kinetic/lib/x86_64-linux-gnu:/opt/ros/kinetic/lib
ENV CATKIN_TEST_RESULTS_DIR=/opt/stdr/build/test_results
ENV CPATH=/opt/stdr/devel/include:/opt/ros/kinetic/include
ENV ROS_TEST_RESULTS_DIR=/opt/stdr/build/test_results
ENV PATH=/opt/stdr/devel/bin:/opt/ros/kinetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/stdr/tools
ENV ROSLISP_PACKAGE_DIRECTORIES=/opt/stdr/devel/share/common-lisp
ENV ROS_DISTRO=kinetic
ENV PYTHONPATH=/opt/stdr/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages
ENV PKG_CONFIG_PATH=/opt/stdr/devel/lib/pkgconfig:/opt/stdr/devel/lib/x86_64-linux-gnu/pkgconfig:/opt/ros/kinetic/lib/x86_64-linux-gnu/pkgconfig:/opt/ros/kinetic/lib/pkgconfig
ENV CMAKE_PREFIX_PATH=/opt/stdr/devel:/opt/ros/kinetic
ENV ROS_ETC_DIR=/opt/ros/kinetic/etc/ros

RUN mkdir -p /opt/stdr
WORKDIR /opt/stdr/
RUN sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list' \
    && apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \
    && apt -y update \
    && apt install -y curl \
    && apt install -y x11-xserver-utils \
    && apt install -y ros-${ROS_DISTRO}-stdr-simulator \
    && apt install -y ros-$ROS_DISTRO-move-base ros-$ROS_DISTRO-amcl \
    && apt install -y ros-$ROS_DISTRO-dwa-local-planner ros-$ROS_DISTRO-global-planner \
    && apt install -y ros-$ROS_DISTRO-gmapping ros-$ROS_DISTRO-hector-mapping \
    && apt install -y ros-$ROS_DISTRO-costmap-2d ros-$ROS_DISTRO-hector-nav-msgs \
    && apt install -y ros-$ROS_DISTRO-map-server ros-$ROS_DISTRO-nav-core \
    && apt install -y ros-$ROS_DISTRO-map-server ros-$ROS_DISTRO-camera-info-manager \
    && apt install -y libsdl2-dev \
    && apt install -y ros-$ROS_DISTRO-rqt \
    && apt install -y ros-$ROS_DISTRO-rqt-common-plugins \
    && apt install -y rosbash \
    && apt install -y ros-$ROS_DISTRO-libuvc \
    && apt install -y qt4-default \
    && apt install -y ros-*-rgbd-launch ros-*-libuvc ros-*-libuvc-camera ros-*-libuvc-ros \
    && apt install -y ros-$ROS_DISTRO-map-server ros-$ROS_DISTRO-bfl \
    && apt install -y ros-$ROS_DISTRO-map-server ros-$ROS_DISTRO-serial \
    && apt install -y ros-$ROS_DISTRO-map-server ros-$ROS_DISTRO-ackermann-msgs \
    && apt install -y vim \
    && apt-get -y autoremove \
    && apt clean \
    && echo "source /opt/ros/kinetic/setup.bash" >> /root/.bashrc

